import axios from '../http';

let base = '/api';

/** 登陆接口 */
export const requestLogin = params => { return axios.post(`${base}/login`, params).then( res => res.data); };

/** 分类查询 */
export const queryCategory = params => { return axios.get(`${base}/category/list`, { params: params }).then(res => res.data); };
/** 分类树查询 */
export const queryCategoryTree = params => {return axios.get(`${base}/category/tree`, { params: params}).then(res => res.data); };
/** 添加分类 */
export const addCategrory = params => { return axios.post(`${base}/category/add`, params).then(res => res.data)}
/** 批量删除 */
export const deleteBatchCategory = params => { return axios.post(`${base}/category/batch/delete`, params).then(res => res.data)}